SRCDIR = test/
LIBDIR = lib/
OBJDIR = obj/

UNAME := $(shell uname)
ifeq ($(UNAME), FreeBSD)
	CXX = g++47
else
	CXX = g++
endif

CC = $(CXX)
CXXFLAGS = -Wall -I /usr/local/include/ -I $(LIBDIR) -std=c++0x -g
LDFLAGS = -g
SRCST = $(wildcard $(SRCDIR)*.cpp)
SRCS = $(SRCST:$(SRCDIR)%=%)
OBJS = $(SRCS:.cpp=.o)

all: $(SRCS:%.cpp=%)

%: $(SRCDIR)%.cpp $(wildcard $(LIBDIR)*)
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $<

$(SRCDIR)%.cpp: $(wildcard $(LIBDIR)*)

cppcheck:
	cppcheck --enable=all --std=c++11 -I $(LIBDIR) $(SRCDIR)*.cpp $(LIBDIR)*.h  $(LIBDIR)*.hpp

.PHONY: clean
clean:
	rm -f *.o
